//
//  LOLInfamacell.m
//  LOLXXbox
//
//  Created by dllo on 16/1/27.
//  Copyright © 2016年 Grasstrio. All rights reserved.
//

#import "LOLInfamacell.h"
#import <Masonry.h>
#import <UIImageView+WebCache.h>
@implementation LOLInfamacell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.iconImageView = [[UIImageView alloc] init];
        [self.contentView addSubview:self.iconImageView];
        
        self.nameLabel = [[UILabel alloc] init];
        [self.contentView addSubview:self.nameLabel];
        
        self.nextImageView = [[UIImageView alloc] init];
        [self.contentView addSubview:self.nextImageView];
    }
    return self;
}
- (void)layoutSubviews{
    [super layoutSubviews];
    [self.iconImageView mas_makeConstraints:^(MASConstraintMaker *make) {
        

        make.top.equalTo(self.contentView).offset(10);
        make.left.equalTo(self.contentView).offset(10);
        make.bottom.equalTo(self.contentView).offset(-10);
        make.right.equalTo(self.nameLabel.mas_left).offset(-10);
        make.width.equalTo(@30);
    }];
    
    [self.nameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.top.equalTo(self.contentView).offset(10);
        make.right.equalTo(self.contentView).offset(-150);
        make.bottom.equalTo(self.contentView).offset(-10);
    }];
    
    [self.nextImageView mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.top.equalTo(self.contentView).offset(10);
        make.right.equalTo(self.contentView).offset(-10);
        make.bottom.equalTo(self.contentView).offset(-10);
        make.width.equalTo(@30);
    }];
    
}
- (void)setInformaModel:(LOLInformaModel *)informaModel{
    _informaModel = informaModel;
    [self.iconImageView sd_setImageWithURL:[NSURL URLWithString:_informaModel.icon]];
    self.nameLabel.text = _informaModel.name;
    self.nextImageView.image = [UIImage imageNamed:@"Next"];
    
}



/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
